module.exports = function (sequelize) {
    var model = sequelize.define("userForRole", {
            "userId": {
                type: sequelize.DataTypes.INTEGER,
                allowNull: false,
                primaryKey: true,
                comment: "用户ID"
            }, "roleCode": {
                type: sequelize.DataTypes.STRING(50),
                allowNull: false,
                primaryKey: true,
                comment: "角色编号"
            }
        },
        {
            "tableName": "user_For_Role",
            "timestamps": false,
        });
    model.initRelation = function () {
        model.belongsTo(db.models.user, {foreignKey: "userId", constraints: false});
        model.belongsTo(db.models.role, {as: "roleObj", foreignKey: "roleCode", constraints: false});
    }
    model.initData = new Array();
    model.initData.push({userId: "1", roleCode: "ADMIN"});
    model.initData.push({userId: "2", roleCode: "ADMIN"});
}